package com.yf.heap;

import java.util.ArrayList;
import java.util.List;

/*
运行参数：-Xms10m -Xmx10m -XX:+PrintGCDetails
 */
public class GCTest {
    public static void main(String[] args) {
        int i = 0;
        try {
            List<String> list = new ArrayList<>();
            String s = "abcdefg";
            while (true) {
                list.add(s);
                s = s + s;
                i++;
            }

        } catch (Throwable t) {
            t.printStackTrace();
            System.out.println("遍历次数: " + i);
        }
    } 
}
